<?php
/**
 *  Form_Element Interface
 *  A Form_Element has a value which must be a string?
 *
 */
interface Yz_Form_Element_Interface
{

    /**
     *  Also a getter may be used: x = $field->errorCode
     *
     */
    public function getError();
    /**
     *  Also a getter may be used: x = $field->value
     *
     */
    public function getName();
    /**
     *  Also a getter may be used: x = $field->value
     *
     */
#    public function getValue();
    /**
     *  Also a setter may be used: $field->value = x
     *
     */
#    public function setValue($value);

    /**
     *  @param Yz_Template_Interface $template
     *  @return string|null
     *  If null, the element will not appear in form at all (eg. when a table is the form's container, no row will be reserved for this element, etc)
     */
    public function render(Yz_Template_Interface $template);

    /**
     *  A value is assumed to be a string or an array; any other type is not possible in POST and is an error
     *  @param string|array $value
     *  @return ?
     *  @throw Yz_Form_Element_Error
     */
#    public function parse($value);
}
